<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>编辑退货单</title>
    <meta name="description" content="这是一个 table 页面">
    <meta name="keywords" content="table">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="../../assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../../assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="../../assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="../../assets/css/admin.css">
    <style>
        #a1,#a2,#a3,#a0{
            vertical-align: middle;
        }
        #a1~*,#a2~*,#a3~*,#a0~*{
            vertical-align: middle;
        }
        [v-cloak]{
            display: none;
        }

    </style>
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
    以获得更好的体验！</p>
<![endif]-->
<div id="box1">
<header class="am-topbar admin-header">
    <div class="am-topbar-brand">
        <strong>三泵订货</strong> <small>后台管理模板</small>
    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
            <li class="am-dropdown" data-am-dropdown>
                <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;" v-cloak>
                    <span class="am-icon-users" id="adminname"></span> <span class="am-icon-caret-down"></span>
                </a>
                <ul class="am-dropdown-content">
                    <li><a href="#" id="tuichu"><span class="am-icon-power-off" ></span> 退出</a></li>
                </ul>
            </li>
            <li><a href="javascript:;" id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> 开启全屏</a></li>
        </ul>
    </div>
</header>

    <!--***********************************-->
    <div class="am-modal am-modal-confirm" style="width: 700px;position: absolute;top: 320px;left: 650px" tabindex="-1" id="my-confirm">
        <div class="am-modal-dialog">
            <div class="admin-content col-md-10">
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf">
                        <strong class="am-text-primary am-text-lg">商品规格</strong>
                        <small></small>
                    </div>
                </div>


                <div class="am-g">
                    <div class="col-md-12">
                        <div class="">
                            <!--                        <table class="am-center am-table am-table-striped am-table-hover table-main">-->
                            <table class="am-table am-table-striped am-table-hover table-main">

                                <thead>
                                <tr>
                                    <th style="text-align: center" class="table-type"><label>+</label></th>
                                    <th style="text-align: center" class="table-title">商品名称</th>
                                    <th style="text-align: center" class="table-type">单价</th>
                                    <th style="text-align: center" class="table-type">小计</th>
                                    <th style="text-align: center" class="table-author">数量</th>
                                    <th style="text-align: center" class="table-author">已退</th>
                                    <th style="text-align: center" class="table-date">备注</th>
                                </tr>
                                </thead>
                                <tbody>
                                <!--               子元素中部对齐父元素中部         style="vertical-align: middle "-->
                                <tr v-for="(val,i) in Wares"  id="tr">
                                    <td style="text-align: center" class="table-check"><input v-show="val.ksum != val.quantity" @click="chex(val,$event)" name="waresCheckbox" type="checkbox"  v-model="waresID" :value="val.id"></td>
                                    <td style="text-align: center">{{val.name}}</td>
                                    <td style="text-align: center">{{val.bPrice}}</td>
                                    <td style="text-align: center">{{val.total}}</td>
                                    <td style="text-align: center">{{val.quantity}}</td>
                                    <td style="text-align: center">{{val.ksum}}</td>
                                    <td style="text-align: center">{{val.remark}}</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <hr>
                    </div>

                </div>


            </div>

            <div class="am-modal-footer">
                <span class="am-modal-btn" data-am-modal-confirm>确定</span>
            </div>
        </div>
    </div>
    <div class="am-cf admin-main" >
        <!-- sidebar start -->
        <div class="admin-sidebar" id="daohang">
            <ul class="am-list admin-sidebar-list" id="accordion">
                <li><a href="../../后台主页.html"  v-if="isShow(0)"><span class="am-icon-home"></span> 首页</a></li>
                <li class=" am-panel admin-parent" v-if="isShow(1)">
                    <a class="am-cf"  data-am-collapse="{parent: '#accordion', target: '#collapse-nav-2'}">
                        <svg id="icon-goods-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M153.6 51.2h716.8c56.32 0 102.4 46.08 102.4 102.4v716.8c0 56.32-46.08 102.4-102.4 102.4H153.6c-56.32 0-102.4-46.08-102.4-102.4V153.6c0-56.32 46.08-102.4 102.4-102.4z" fill="#A1B8C2"></path><path d="M153.6 51.2h716.8c56.32 0 102.4 46.08 102.4 102.4v716.8c0 56.32-46.08 102.4-102.4 102.4H153.6c-56.32 0-102.4-46.08-102.4-102.4V153.6c0-56.32 46.08-102.4 102.4-102.4z m0 51.2c-30.72 0-51.2 20.48-51.2 51.2v716.8c0 30.72 20.48 51.2 51.2 51.2h716.8c30.72 0 51.2-20.48 51.2-51.2V153.6c0-30.72-20.48-51.2-51.2-51.2H153.6z" fill="#6D8994"></path><path d="M353.28 435.2V460.8c0 97.28 71.68 179.2 158.72 179.2s158.72-81.92 158.72-179.2v-25.6c-5.12-10.24-5.12-15.36-5.12-25.6 0-30.72 20.48-51.2 51.2-51.2s51.2 20.48 51.2 51.2-20.48 51.2-51.2 51.2c0 128-92.16 230.4-204.8 230.4s-204.8-102.4-204.8-230.4c-30.72 0-51.2-20.48-51.2-51.2s20.48-51.2 51.2-51.2 51.2 20.48 51.2 51.2c0 10.24 0 15.36-5.12 25.6z" fill="#FFFFFF"></path></svg>
                        商品<span class="am-icon-angle-right am-fr am-margin-right"></span>
                    </a>

                    <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-2">
                        <li><a href="../wares/商品列表.html">商品列表</a></li>
                        <li><a href="../wares/商品价格.html">商品价格</a></li>
                        <li><a href="../wares/基础信息.html">基础信息</a></li>
                        <li><a href="../wares/商品图片.html">商品图片<span class="am-badge am-badge-secondary am-margin-right am-fr">24</span></a></li>
                    </ul>
                </li>
                <li class=" am-panel admin-parent" v-if="isShow(2)">
                    <a class="am-cf"  data-am-collapse="{parent: '#accordion', target: '#collapse-nav-3'}">
                        <svg id="icon-sell-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M414.72 1024H153.6c-56.32 0-102.4-46.08-102.4-102.4V102.4c0-56.32 46.08-102.4 102.4-102.4h261.12c10.24 30.72 40.96 51.2 71.68 51.2s61.44-20.48 71.68-51.2H819.2c56.32 0 102.4 46.08 102.4 102.4v819.2c0 56.32-46.08 102.4-102.4 102.4h-261.12c-10.24-30.72-40.96-51.2-71.68-51.2s-61.44 20.48-71.68 51.2z" fill="#A1B8C2"></path><path d="M153.6 1024c-56.32 0-102.4-46.08-102.4-102.4V102.4c0-56.32 46.08-102.4 102.4-102.4h261.12c10.24 30.72 40.96 51.2 71.68 51.2s61.44-20.48 71.68-51.2H819.2c56.32 0 102.4 46.08 102.4 102.4v819.2c0 56.32-46.08 102.4-102.4 102.4h-261.12c-10.24-30.72-40.96-51.2-71.68-51.2s-61.44 20.48-71.68 51.2H153.6z m332.8-102.4c40.96 0 76.8 20.48 102.4 51.2H819.2c30.72 0 51.2-20.48 51.2-51.2V102.4c0-30.72-20.48-51.2-51.2-51.2h-230.4c-25.6 30.72-61.44 51.2-102.4 51.2s-76.8-20.48-102.4-51.2H153.6c-30.72 0-51.2 20.48-51.2 51.2v819.2c0 30.72 20.48 51.2 51.2 51.2h230.4c25.6-30.72 61.44-51.2 102.4-51.2zM768 51.2h51.2v51.2h-51.2V51.2z m0 870.4h51.2v51.2h-51.2v-51.2z m0-768h51.2v102.4h-51.2V153.6z m0 153.6h51.2v102.4h-51.2V307.2z m0 153.6h51.2v102.4h-51.2V460.8z m0 153.6h51.2v102.4h-51.2v-102.4z m0 153.6h51.2v102.4h-51.2v-102.4zM153.6 51.2h51.2v51.2H153.6V51.2z m0 870.4v51.2h51.2v-51.2H153.6zM153.6 153.6h51.2v102.4H153.6V153.6z m0 153.6h51.2v102.4H153.6V307.2z m0 153.6h51.2v102.4H153.6V460.8z m0 153.6h51.2v102.4H153.6v-102.4z m0 153.6h51.2v102.4H153.6v-102.4z" fill="#6D8994"></path><path d="M337.92 225.28l179.2 179.2c10.24 10.24 10.24 25.6 0 35.84-10.24 10.24-25.6 10.24-35.84 0L302.08 261.12c-10.24-10.24-10.24-25.6 0-35.84 10.24-10.24 25.6-10.24 35.84 0z" fill="#FFFFFF"></path><path d="M455.68 404.48l179.2-179.2c10.24-10.24 25.6-10.24 35.84 0 10.24 10.24 10.24 25.6 0 35.84L491.52 440.32c-10.24 10.24-25.6 10.24-35.84 0-10.24-10.24-10.24-25.6 0-35.84z" fill="#FFFFFF"></path><path d="M332.8 409.6h307.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-307.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6zM332.8 512h307.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-307.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#FFFFFF"></path><path d="M512 409.6v384c0 15.36-10.24 25.6-25.6 25.6s-25.6-10.24-25.6-25.6V409.6h51.2z" fill="#FFFFFF"></path></svg>
                        订单<span class="am-icon-angle-right am-fr am-margin-right"></span>
                    </a>

                    <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav-3">
                        <li class=" am-panel admin-parent" v-if="isShow(2)">
                            <a class="am-cf"  data-am-collapse="{parent: '#collapse-nav-3', target: '#collapse-nav-3-1'}">
                                <span>+&nbsp;&nbsp;&nbsp;</span>订单管理</a>
                            <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-3-1">
                                <li><a href="订货单.html">订货单</a></li>
                                <li><a href="待审核订单.html">待审核订单</a></li>
                                <li><a href="代客下单.html">代客下单</a></li>
                                <li><a href="待收款订单.html">待收款订单</a></li>
                            </ul>
                        </li>
                        <li class=" am-panel admin-parent" v-if="isShow(2)">
                            <a class="am-cf"  data-am-collapse="{parent: '#collapse-nav-3', target: '#collapse-nav-3-2'}">
                                <span>+&nbsp;&nbsp;&nbsp;</span>订单汇总</a>
                            <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-3-2">
                                <li><a href="发货记录.html">发货记录</a></li>
                                <li><a href="按发货汇总.html">按发货汇总</a></li>
                                <li><a href="按商品汇总.html">按商品汇总</a></li>
                                <li><a href="按客户汇总.html">按客户汇总</a></li>
                            </ul>
                        </li>
                        <li class=" am-panel admin-parent" v-if="isShow(2)">
                            <a class="am-cf"  data-am-collapse="{parent: '#collapse-nav-3', target: '#collapse-nav-3-3'}">
                                <span>+&nbsp;&nbsp;&nbsp;</span>退货管理</a>
                            <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav-3-3">
                                <li><a href="退货单.html">退货单</a></li>
                                <li><a href="新增退货单.html">新增退货单</a></li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li class=" am-panel admin-parent" v-if="isShow(3)">
                    <a class="am-cf"  data-am-collapse="{parent: '#accordion', target: '#collapse-nav-4'}">
                        <svg id="icon-client-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M609.098914 322.338445l316.72223 185.160688c14.617949 9.745299 24.363248 19.490599 24.363248 34.108548V1024H73.107449V239.503401c0-14.617949 9.745299-34.108548 24.363249-43.853847L462.919424 10.488866c48.726497-24.363248 107.198293-4.87265 131.561541 43.853847 9.745299 14.617949 14.617949 29.235898 14.617949 43.853847v224.141885z" fill="#A1B8C2"></path><path d="M950.184392 975.273503h24.363249c14.617949 0 24.363248 9.745299 24.363248 24.363249s-9.745299 24.363248-24.363248 24.363248H48.744201c-14.617949 0-24.363248-9.745299-24.363249-24.363248s9.745299-24.363248 24.363249-24.363249H73.107449V239.503401c0-14.617949 9.745299-34.108548 24.363249-43.853847L462.919424 10.488866c48.726497-24.363248 107.198293-4.87265 131.561541 43.853847 9.745299 14.617949 14.617949 29.235898 14.617949 43.853847v224.141885l316.72223 185.160688c14.617949 9.745299 24.363248 19.490599 24.363248 34.108548V975.273503zM121.833946 975.273503h438.538472V98.19656c0-9.745299 0-14.617949-4.87265-24.363248-14.617949-19.490599-43.853847-29.235898-68.217096-19.490599L121.833946 239.503401V975.273503z m487.264968 0h292.358982v-428.793172l-292.358982-165.670089V975.273503z" fill="#6D8994"></path><path d="M730.915157 634.188025c14.617949 0 24.363248 9.745299 24.363248 24.363249v97.452993c0 14.617949-9.745299 24.363248-24.363248 24.363249s-24.363248-9.745299-24.363249-24.363249v-97.452993c0-14.617949 9.745299-24.363248 24.363249-24.363249zM341.103182 244.376051c14.617949 0 24.363248 9.745299 24.363248 24.363248v97.452994c0 14.617949-9.745299 24.363248-24.363248 24.363248S316.739933 380.810242 316.739933 366.192293v-97.452994c0-14.617949 9.745299-24.363248 24.363249-24.363248zM341.103182 488.008535c14.617949 0 24.363248 9.745299 24.363248 24.363248v97.452994c0 14.617949-9.745299 24.363248-24.363248 24.363248s-24.363248-9.745299-24.363249-24.363248v-97.452994c0-14.617949 9.745299-24.363248 24.363249-24.363248zM341.103182 731.641019c14.617949 0 24.363248 9.745299 24.363248 24.363248v97.452994c0 14.617949-9.745299 24.363248-24.363248 24.363248s-24.363248-9.745299-24.363249-24.363248v-97.452994c0-14.617949 9.745299-24.363248 24.363249-24.363248z" fill="#FFFFFF"></path></svg>
                        客户<span class="am-icon-angle-right am-fr am-margin-right"></span>
                    </a>

                    <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-4">
                        <li><a href="../customer/客户列表.html">客户列表</a></li>
                        <li><a href="../customer/客户分布.html">客户分布</a></li>
                    </ul>
                </li>
                <li class=" am-panel admin-parent" v-if="isShow(4)">
                    <a class="am-cf"  data-am-collapse="{parent: '#accordion', target: '#collapse-nav-5'}">
                        <svg id="icon-warehouse-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M204.8 1024H102.4c-30.72 0-51.2-20.48-51.2-51.2V486.4C51.2 215.04 256 0 512 0s460.8 215.04 460.8 486.4V972.8c0 30.72-20.48 51.2-51.2 51.2h-102.4c-30.72 0-51.2-20.48-51.2-51.2v-51.2H256v51.2c0 30.72-20.48 51.2-51.2 51.2z" fill="#A1B8C2"></path><path d="M204.8 1024H102.4c-30.72 0-51.2-20.48-51.2-51.2V486.4C51.2 215.04 256 0 512 0s460.8 215.04 460.8 486.4V972.8c0 30.72-20.48 51.2-51.2 51.2h-102.4c-30.72 0-51.2-20.48-51.2-51.2v-51.2H256v51.2c0 30.72-20.48 51.2-51.2 51.2z m0-51.2v-102.4h614.4v102.4h102.4V486.4C921.6 245.76 737.28 51.2 512 51.2S102.4 245.76 102.4 486.4V972.8h102.4z m25.6-204.8h563.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-563.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#6D8994"></path><path d="M230.4 665.6h563.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-563.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6zM230.4 563.2h563.2c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-563.2c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#6D8994"></path><path d="M230.4 358.4h204.8c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-204.8c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6zM588.8 358.4h204.8c15.36 0 25.6 10.24 25.6 25.6s-10.24 25.6-25.6 25.6h-204.8c-15.36 0-25.6-10.24-25.6-25.6s10.24-25.6 25.6-25.6z" fill="#FFFFFF"></path></svg>
                        仓库<span class="am-icon-angle-right am-fr am-margin-right"></span>
                    </a>

                    <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-5">
                        <li><a href="../warehouse/商品出库.html">商品出库</a></li>
                        <li><a href="../warehouse/商品入库.html">商品入库</a></li>
                        <li><a href="../warehouse/商品库存.html">商品库存</a></li>
                        <li><a href="../warehouse/库存调拨.html">库存调拨</a></li>
                        <li><a href="../warehouse/库存盘点.html">库存盘点</a></li>
                        <li><a href="../warehouse/出入库明细.html">出入库明细</a></li>
                    </ul>
                </li>
                <li class=" am-panel admin-parent" v-if="isShow(5)">
                    <a class="am-cf"  data-am-collapse="{parent: '#accordion', target: '#collapse-nav-6'}">
                        <svg id="icon-purchase-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px"><path d="M61.44 307.2h906.24c30.72 0 51.2 20.48 51.2 51.2v10.24l-81.92 522.24c-10.24 51.2-51.2 87.04-102.4 87.04H189.44c-51.2 0-92.16-35.84-102.4-87.04L10.24 368.64C5.12 337.92 25.6 312.32 51.2 307.2h10.24z" fill="#A1B8C2"></path><path d="M61.44 307.2h906.24c30.72 0 51.2 20.48 51.2 51.2v10.24l-81.92 522.24c-10.24 51.2-51.2 87.04-102.4 87.04H189.44c-51.2 0-92.16-35.84-102.4-87.04L10.24 368.64C5.12 337.92 25.6 312.32 51.2 307.2h10.24z m0 51.2l81.92 522.24c5.12 25.6 25.6 40.96 51.2 40.96h645.12c25.6 0 46.08-20.48 51.2-40.96L962.56 358.4H61.44z" fill="#6D8994"></path><path d="M481.28 512v286.72c0 15.36 10.24 25.6 25.6 25.6s25.6-10.24 25.6-25.6V512c0-15.36-10.24-25.6-25.6-25.6s-25.6 10.24-25.6 25.6zM230.4 517.12l30.72 286.72c0 15.36 15.36 25.6 25.6 20.48 15.36 0 25.6-15.36 20.48-25.6l-25.6-291.84c0-15.36-15.36-25.6-25.6-20.48-15.36 0-25.6 15.36-25.6 30.72zM783.36 517.12l-30.72 286.72c0 15.36-15.36 25.6-25.6 20.48-15.36 0-25.6-15.36-20.48-25.6l30.72-286.72c0-15.36 15.36-25.6 25.6-20.48 10.24-5.12 20.48 10.24 20.48 25.6z" fill="#FFFFFF"></path><path d="M358.4 102.4h307.2c20.48 0 35.84 10.24 46.08 30.72L819.2 358.4H204.8l107.52-225.28c10.24-20.48 25.6-30.72 46.08-30.72z m307.2 51.2H358.4L286.72 307.2h450.56L665.6 153.6z" fill="#6D8994"></path></svg>
                        采购<span class="am-icon-angle-right am-fr am-margin-right"></span>
                    </a>

                    <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-6">
                        <li><a href="../purchase/采购订单.html">采购订单</a></li>
                        <li><a href="../purchase/采购退货.html">采购退货</a></li>
                        <li><a href="../purchase/供应商管理.html">供应商管理</a></li>
                        <li><a href="../purchase/供应商对账.html">供应商对账</a></li>
                        <li><a href="../purchase/库存预警.html">库存预警</a></li>
                    </ul>
                </li>
                <li class=" am-panel admin-parent" v-if="isShow(6)">
                    <a class="am-cf"  data-am-collapse="{parent: '#accordion', target: '#collapse-nav-7'}">
                        <svg id="icon-purchase-20ade5-n" viewBox="0 0 1024 1024" width="15px" height="15px" ><path d="M61.44 307.2h906.24c30.72 0 51.2 20.48 51.2 51.2v10.24l-81.92 522.24c-10.24 51.2-51.2 87.04-102.4 87.04H189.44c-51.2 0-92.16-35.84-102.4-87.04L10.24 368.64C5.12 337.92 25.6 312.32 51.2 307.2h10.24z" fill="#A1B8C2"></path><path d="M61.44 307.2h906.24c30.72 0 51.2 20.48 51.2 51.2v10.24l-81.92 522.24c-10.24 51.2-51.2 87.04-102.4 87.04H189.44c-51.2 0-92.16-35.84-102.4-87.04L10.24 368.64C5.12 337.92 25.6 312.32 51.2 307.2h10.24z m0 51.2l81.92 522.24c5.12 25.6 25.6 40.96 51.2 40.96h645.12c25.6 0 46.08-20.48 51.2-40.96L962.56 358.4H61.44z" fill="#6D8994"></path><path d="M481.28 512v286.72c0 15.36 10.24 25.6 25.6 25.6s25.6-10.24 25.6-25.6V512c0-15.36-10.24-25.6-25.6-25.6s-25.6 10.24-25.6 25.6zM230.4 517.12l30.72 286.72c0 15.36 15.36 25.6 25.6 20.48 15.36 0 25.6-15.36 20.48-25.6l-25.6-291.84c0-15.36-15.36-25.6-25.6-20.48-15.36 0-25.6 15.36-25.6 30.72zM783.36 517.12l-30.72 286.72c0 15.36-15.36 25.6-25.6 20.48-15.36 0-25.6-15.36-20.48-25.6l30.72-286.72c0-15.36 15.36-25.6 25.6-20.48 10.24-5.12 20.48 10.24 20.48 25.6z" fill="#FFFFFF"></path><path d="M358.4 102.4h307.2c20.48 0 35.84 10.24 46.08 30.72L819.2 358.4H204.8l107.52-225.28c10.24-20.48 25.6-30.72 46.08-30.72z m307.2 51.2H358.4L286.72 307.2h450.56L665.6 153.6z" fill="#6D8994"></path></svg>
                        财务<span class="am-icon-angle-right am-fr am-margin-right"></span>
                    </a>

                    <ul class="am-list am-collapse admin-sidebar-sub" id="collapse-nav-7">
                        <li><a href="../finance/收款单.html">收款单</a></li>
                        <li><a href="../finance/付款单.html">付款单</a></li>
                        <li><a href="../finance/收支流水.html">收支流水</a></li>
                        <li><a href="../finance/客户对账.html">客户对账</a></li>
                        <li><a href="../finance/资金账户.html">资金账户</a></li>
                    </ul>
                </li>

            </ul>

            <div class="am-panel am-panel-default admin-sidebar-panel">
                <div>
                    <p><span class="am-icon-bookmark"></span> 公告</p>
                    <p>时光静好，与君语；细水流年，与君同。—— Amaze UI</p>
                </div>
            </div>

            <div class="am-panel am-panel-default admin-sidebar-panel">
                <div>
                    <p><span class="am-icon-tag"></span> wiki</p>
                    <p>Welcome to the Amaze UI wiki!</p>
                </div>
            </div>
        </div>
        <!-- sidebar end -->

        <!-- content start -->
        <div class="admin-content">
            <div class="am-cf am-padding">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">订单</strong>/
                    <span>编辑退货单</span>
                    <small></small>
                </div>
            </div>
            <div class="admin-content col-sm-12">
                <div class="admin-content am-g">

                    <div class="am-form-group am-margin-left col-md-12" >

                        <form class="am-form am-form-horizontal">
                            <div class="am-form-group">
                                <label class="col-sm-2 am-form-label"><label  style="color: red">*</label>客户:</label>
                                <div class="col-sm-4">
                                   <input type="text" readonly :value="User.name">
                                </div>
                                <label class="col-sm-2 am-form-label"><label  style="color: red">*</label>订单:</label>
                                <div class="col-sm-4">
                                    <input type="text" readonly :value="buyReturn.orderCode">
                                </div>
                            </div>
                        </form>
                    </div>

                </div>


                <div class="am-g am-margin-top"><strong class="am-text-primary am-text-lg"><h4 style="display: inline-block">|退货清单</h4></strong>(<label style="color: red">*</label>必填)</div>
                <div  class="am-g am-margin-top">
                    <table class="am-table am-table-bd">
                        <thead>
                        <tr class="am-g">
                            <th style="text-align: center;vertical-align: middle" class=" col-md-2 am-text-middle th-box">序号</th>
                            <th style="text-align: center;vertical-align: middle" class="table-date col-md-1 am-text-middle th-box">规格图</th>
                            <th style="text-align: center;vertical-align: middle" class="table-title col-md-2 am-text-middle th-box">商品名称/商品编号</th>
                            <th style="text-align: center;vertical-align: middle" class="table-type col-md-1 am-text-middle th-box">退货数量</th>
                            <th style="text-align: center;vertical-align: middle" class="table-author col-md-1 am-text-middle th-box">退货单价</th>
                            <th style="text-align: center;vertical-align: middle" class="table-author col-md-2 am-text-middle th-box">单位</th>
                            <th style="text-align: center;vertical-align: middle" class="table-set col-md-1 am-text-middle th-box">小计</th>
                            <th style="text-align: center;vertical-align: middle" class="table-set col-md-2 am-text-middle th-box">备注</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr class="am-g"  v-for="(val,i,index) in Wares2">
                            <td style="text-align: center;vertical-align: middle" class="td-box">{{index+1}}</td>
                            <td style="text-align: center;vertical-align: middle" class="td-box"><img :src="'http://192.168.2.80:5050/images/tpo/'+val.log" /></td>
                            <td style="text-align: center;vertical-align: middle" class="td-box">{{val.name}}/{{val.id}}</td>
                            <td style="text-align: center;vertical-align: middle" class="td-box"><input  type="number" @change="change$()" min="1" :max="val.quantity2"  class="num" v-model="val.quantity" :oninput="oninput(val.quantity,val.quantity2,val.returnNum,i)"></td>
                            <td style="text-align: center;vertical-align: middle" class="td-box"  ><span class="td1">{{val.bPrice}}</span></td>
                            <td style="text-align: center;vertical-align: middle" class="td-box">{{val.unit}}</td>
                            <td style="text-align: center;vertical-align: middle" class="td-box"><span class="span1">{{val.quantity==null ? 0 : val.bPrice * val.quantity}}</span></td><!--//??疑问vue的标签是否能直接动态改变数组对象中的属性值-->
                            <td style="text-align: center;vertical-align: middle" class="td-box"><input type="text"  v-model="val.remark"></td>
                        </tr>
                        <tr class="am-g">
                            <td colspan="8" class="th-box">
                                <a style="text-align: center" @click="show1()" ><strong class="am-text-primary"><h6><span class="am-icon-plus"></span>添加退货清单</h6></strong></a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="am-fr">
                        <label>+调整金额</label><input @change="change$()" v-model="t" style="display: inline" type="number" class="am-form-field" value="0"><label>合计金额</label>￥<h1 style="color: red;display: inline-block" v-text="t2">0.00</h1>
                    </div>
                    <div class="tpl-portlet-components" style=" border-bottom: 2px solid #000">

                        <div class="tpl-block ">

                            <div class="am-g tpl-amazeui-form">


                                <div class="am-u-sm-12 am-u-md-9">
                                    <form class="am-form am-form-horizontal">

                                        <div class="am-form-group col-md-5" style="display: inline-block">
                                            <label class="am-u-sm-3 am-form-label">收货仓库 </label>
                                            <div class="am-u-sm-9">
                                                <select v-model="defaultWarehouse" style="display: inline">
                                                    <option disabled  value="">请选择收货仓库</option>
                                                    <option value="1">华中仓</option>
                                                    <option value="2">华北仓</option>
                                                    <option value="3">华南仓</option>
                                                    <option value="4">华东仓</option>
                                                    <option value="5">西南仓</option>
                                                    <option value="6">西北仓</option>
                                                    <option value="7">东北仓</option>
                                                </select>
                                            </div>
                                        </div>


                                        <br>


                                        <div  class="am-form-group col-md-5" style="display: inline-block">
                                            <label  class="am-u-sm-3 am-form-label">退货时间</label>
                                            <div class="am-u-sm-9">
                                                <input  v-model="returnDate" type="date"  id="user-phone10"  placeholder="请输入退货时间">
                                            </div>
                                        </div>
                                        <div  class="am-form-group col-md-5" style="display: inline-block">
                                            <label  class="am-u-sm-3 am-form-label">备注说明</label>
                                            <div class="am-u-sm-9">
                                                <input  v-model="remark" type="tel" id="user-phone100"  placeholder="填写一些说明吧">
                                            </div>
                                        </div>
                                        <br>


                                        <div style="display: inline-block" class="am-form-group col-md-5" style="display: inline-block">
                                            <label  class="am-u-sm-3 am-form-label">附件信息:</label>
                                            <a href="">✉添加附件</a><span>（单个附件最大支持10M，支持格式：jpg、jpeg、png）</span>
                                        </div>
                                        <div style="display: inline-block" class="">
                                            <input @click="insertBuyReturn()" class="am-text-primary am-text-lg" type="button" value="√保存">
                                            <input class="am-text-primary am-text-lg" type="button" value="×取消">
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- content end -->


<script src="../../assets/js/zepto.min.js"></script>
<script src="../../assets/js/amazeui.min.js"></script>
<script src="../../assets/js/app.js"></script>
<script src="../../js/vue.js"></script>
<script src="../../js/axios.min.js"></script>
<script>

    var id = sessionStorage["updateBuyReturnId"]

    Date.prototype.format = function(fmt) {
        var o = {
            "M+" : this.getMonth()+1,                 //月份
            "d+" : this.getDate(),                    //日
            "h+" : this.getHours(),                   //小时
            "m+" : this.getMinutes(),                 //分
            "s+" : this.getSeconds(),                 //秒
            "q+" : Math.floor((this.getMonth()+3)/3), //季度
            "S"  : this.getMilliseconds()             //毫秒
        };
        if(/(y+)/.test(fmt)) {
            fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
        }
        for(var k in o) {
            if(new RegExp("("+ k +")").test(fmt)){
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
            }
        }
        return fmt;
    }

    let vue1 = new Vue({
        el:"#box1",
        data:{
            defaultWarehouse:"", //收货仓库
            user:"",//用户
            userId:"",//用户ID
            returnDate:"",//退货时间
            remark:"",//备注
            accessory:"",//附件
            reAmount:0,//退款金额
            t:-10,//调整的金额
            t2:0,//合计金额
            OrderList:[],//用户所有订单
            order:"",//选择的订单
            Wares:[],//该订单的明细集合
            waresID:[],//多选框选中的商品id
            Wares2:{},//选中的商品
            buyReturn:{},//退货单
            User:{}, //退货单所属客户
            adminname:'',
        },
        methods:{
            selectBuyReturn(){ //查询这个退货单
                axios.get("/order/SelectBuyReturn",{params:{id:id}}).then(res=>{
                    vue1.buyReturn = res.data;
                    vue1.selectUsers(vue1.buyReturn.userId)
                    vue1.selectWares()//查询对应的订单所有的商品
                    vue1.selectWares2()//查询退货单所有的商品
                })
            },
            selectUsers(id){ //查询客户
                axios.get("/order/SelectUser",{params:{id:id}}).then(res=>{
                    vue1.User = res.data;
                }).catch(err=>{
                    alert("查询客户失败")
                })
            },
            change$(){
                var ts = 0
                $.each(vue1.Wares2,function (i,val) {
                    ts = val.bPrice * val.quantity + ts
                })
                vue1.t2 = parseFloat(vue1.reAmount) + parseFloat(vue1.t) + parseFloat(ts)
            },
            show1(){//弹出清单商品
                $('#my-confirm').modal({
                    relatedElement: this,
                    onConfirm: function () {
                    },
                    onCancel: function () {
                    }
                });
            },
            selectWares() {//查询对应的订单所有的商品
                axios.get("/order/SelectDetailList", {params: {orderId: vue1.buyReturn.orderCode, type: 1}}).then(res => {
                    if (res.data != null && res.data != '') {
                        $.each(res.data, function (i, val) {
                            val.remark = val.brand
                            val.total = val.quantity * val.bPrice
                        })
                    }
                    vue1.Wares = res.data
                })
            },
            selectWares2(){ //查询退货单所有的商品
                axios.get("/order/SelectDetailList2", {params: {orderId: vue1.buyReturn.code, type: 2}}).then(res => {
                    if (res.data != null && res.data != '') {
                        $.each(res.data, function (i, val) {
                            val.remark = val.brand
                            val.total = val.quantity * val.bPrice
                            vue1.waresID.push(val.id)
                            vue1.Wares2[val.id] = val
                        })
                    }

                })
            },
            chex(val,e){//选择加入清单的商品,得到显示商品数组
                if ($(e.target).prop('checked')){
                    val.quantity2 = val.quantity //退货数量
                    Vue.set(vue1.Wares2,val.id,val)
                    console.log(vue1.Wares2)
                }else{
                    Vue.set(vue1.Wares2,val.id,null)
                    delete vue1.Wares2[val.id]
                    console.log(vue1.Wares2)
                }
                vue1.change$()
            },
            //数量限制在购买商品数量  quantity 退货数,quantity2 商品数量 , returnNum 已退货数量, i 键
            oninput(quantity, quantity2,returnNum, i){
                if(quantity > quantity2 - returnNum){
                    vue1.Wares2[i].quantity = quantity2 - returnNum
                }else if(quantity < 0){
                    vue1.Wares2[i].quantity = 1
                }
            },
            insertBuyReturn(){ //新增退货单,改变订单明细的退货数计数
                var buyReturn = {} // 退货单
                var list = [] //新增的退货清单
                var list2 = []//修改的订单明细
                var stock_order = {} // 入库单
                var stock_list = [] //入库清单
                var getStock = {} //入库清单list和入库单对象
                buyReturn.userId = vue1.userId
                buyReturn.amount = vue1.t2
                buyReturn.order = vue1.order.order
                buyReturn.returnDate = vue1.returnDate + " 00:00:00"
                buyReturn.reAmount = vue1.reAmount
                buyReturn.houseId = vue1.defaultWarehouse
                buyReturn.single = "龚龚"
                buyReturn.remark = vue1.remark
                buyReturn.accessory = "无"
                buyReturn.orderCode = vue1.order.code
                $.each(vue1.Wares2,function (i,value) {//放入商品清单
                    value.total = value.quantity * value.bPrice
                    value.type = 2
                    value.wa_spId = value.id
                    list.push(value) //放入退货清单
                    value.waresId = value.id
                    stock_list.push(value) //放入入库清单
                    var num = value.quantity //得到退货数量
                    var id = value.sum //得到订单明细id
                    var value2 = {} //修改的订单明细
                    value2.returnNum = num //退货数量赋值,只用来改变订单清单的
                    value2.id = id
                    list2.push(value2) //放入订单修改明细
                })
                buyReturn.list = list //新增的退货清单
                buyReturn.list2 = list2 //修改的订单明细
                stock_order.type = 11
                stock_order.status = 1
                stock_order.houseId = vue1.defaultWarehouse
                stock_order.single = "龚龚"
                stock_order.subDate = new Date().format("yyyy-MM-dd hh:mm:ss")
                stock_order.preDate = vue1.returnDate + " 00:00:00"
                stock_order.remark = vue1.remark
                //新增退货单
                axios.post("/order/InsertBuyReturn",buyReturn).then(res=>{
                    if(res.data != null && res.data != ""){
                        stock_order.relCode = res.data;
                        getStock.stock_order = stock_order
                        getStock.list = stock_list
                        axios({//新增入库单
                            method:"POST",
                            url:"/wares/addStock_order",
                            data:getStock,
                        }).then(res=>{
                            if(res.data.obj>0){
                                window.location.href = "退货单.html";
                            }else {
                                alert("新增入库单失败")
                            }
                        })
                    }else {
                        alert("新增退货单失败")
                    }
                })
            },
        },
        mounted(){
            this.selectBuyReturn()
            var ca = document.cookie.split(';')[0];
            var bb=ca.toString().substring(ca.indexOf("|")+1);
            this.adminname=bb;
            // alert(bb);
        }
    })



</script>
<script src="../../js/qiandel.js"></script>
</body>
</html>
